Repository navigation
feat(PhyslibAlpha): the spin-1/2 representation is given by half the Pauli matrices - #2099
Conversation
…Pauli matrices Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you for this pull-request (PR). If this is your first PR, welcome to the community! While you wait for a review, note that you can review PRs too; reviewing is not restricted to maintainers. Our review guidelines explain what to look for. Over time, contributions such as reviews, maintenance and documentation are recorded on contributions.physlib.io. Three main points:
|
jstoobysmith
left a comment
There was a problem hiding this comment.
Approved - will merge now.
08a6c1b
This PR adds PhyslibAlpha/QuantumMechanics/AngularMomentum/SpinHalf.lean and links the abstract spin-½ representation standard 1 to the Pauli matrices. The new file contains 110 lines with seven lemmas and does not introduce any new definitions.
Previously, these two aspects were separate: spin ½ as standard 1 from the sl2 construction in PhyslibAlpha, and the Pauli matrices in Physlib/Relativity/PauliMatrices. A search in Physlib, PhyslibAlpha, and QuantumInfo did not yield any existing lemmas that express this identification.
The seven lemmas show:
The matrices of Jx, Jy, and Jz in standard 1 are exactly σ₁ / 2, σ₂ / 2, and σ₃ / 2.
The ladder operators J₊ and J₋ have the matrices [[0, 1], [0, 0]] and [[0, 0], [1, 0]], respectively, i.e., σ₊ and σ₋.
The normalized basis vectors normVec 1 0 and normVec 1 1 correspond to the standard basis vectors v 0 and v 1.
This makes the connection between the abstract spin-½ representation “standard 1” and the Pauli matrices from Physlib/Relativity/PauliMatrices explicit. The basis lemmas also show that the normalized basis of the CG files over ℝ is exactly the standard basis. The notations |↑⟩ = v₀ and |↓⟩ = v₁ thus use the same indexing on both sides. This PR does not contain a lemma that connects the real basis to the complex basis.
Conventions:
We have ℏ = 1. The indices 0, 1, 2 denote the x-, y-, and z-component.
The basis is arranged such that
|↑⟩ = |0⟩ = v 0 has the eigenvalue m = +½,
|↓⟩ = |1⟩ = v 1 has the eigenvalue m = −½.
Thus, σ₃|↑⟩ = +|↑⟩. The ladder operators use the Condon–Shortley phase without an additional sign, i.e., J₊|↓⟩ = +|↑⟩.
Structure and Proofs:
The matrix identities are proven entry-by-entry using ext and fin_cases i <;> fin_cases j. The case distinction is thus performed over the four matrix entries (i, j). For J₊ and J₋, the expressions are first rewritten in terms of ρE and ρF, respectively, using the existing lemmas standard_Jp and standard_Jm; their definitions are then applied. For the remaining matrix equalities, the required definitions of ρE, ρF, and ρH are applied. The results are in a separate file because they import the Pauli matrices from Physlib. Addition.lean should not have this additional dependency.
LinearMap.toMatrix' is used for the matrix representation: StandardSl2Module ℂ 1 is Fin 2 → ℂ, so toMatrix' directly returns the matrix with respect to the standard basis.
Deliberately not included in this PR:
Verification:
Verified based on the master branch at commit be0a9ee. The following tests were successful:
Build of the new module
lint-style.sh
alphaPythonLinters.sh
module_doc_lint
alphaFileImports
Batteries-#lint for PhyslibAlpha
lint_all and auxillary_script_test were not run.
Related PRs and Issues:
#2007 – CG circuit for ½ ⊗ ½
#2031 – Commutator of the Pauli matrices with the Levi-Civita symbol
#2010 – Ry
#1960 – Moving the qubit file from QuantumInfo to Physlib